package com.leadingsoft.pwxk.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.Cacheable;
import org.springframework.stereotype.Service;

import com.leadingsoft.pwxk.converter.WaterDrainApplyConverter;
import com.leadingsoft.pwxk.dto.WaterDrainApplyDto;
import com.leadingsoft.pwxk.model.AirPollutionOrg;
import com.leadingsoft.pwxk.model.WaterDrainApply;
import com.leadingsoft.pwxk.repository.WaterDrainApplyRepository;
import com.leadingsoft.pwxk.service.WaterDrainApplyService;

@Service
public class WaterDrainApplyServiceImpl implements WaterDrainApplyService {

	@Autowired
	private WaterDrainApplyRepository waterDrainApplyRepository;
	@Autowired
	private WaterDrainApplyConverter waterDrainApplyConverster;

	@Override
	public WaterDrainApplyDto get(String dataid) {
		return waterDrainApplyConverster.toDto(waterDrainApplyRepository.findByDataid(dataid));
	}

	@Cacheable(cacheNames = "waterApp", sync = true)
	@Override
	public WaterDrainApply findById(Long id) {
		WaterDrainApply one = waterDrainApplyRepository.findById(id).get();
		return one;

	}

}
